package cn.hairui.blog.service;

import cn.hairui.blog.dao.UserMapper;
import cn.hairui.blog.entity.User;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 用户信息表 服务实现类
 * </p>
 *
 * @author laoganbu
 * @since 2020-04-07
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {

    @Autowired
    private UserMapper userMapper;
    @Override
    public List<Map> list() {
        return userMapper.list();
    }

    @Override
    public void updateStatusByAccount(String account, String status) {
        userMapper.updateStatusByAccount(account,status);
    }

    @Override
    public User getByAccountAndPassword(String account, String password) {
        return userMapper.getByAccountAndPassword(account,password);
    }

    @Override
    public User getByAccount(String account) {
        return userMapper.getByAccount(account);
    }

    @Override
    public User getByEmail(String email) {
        return userMapper.getByEmail(email);
    }

}
